package com.powernode.springboot.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig2 {
    //假设Address是三方库的bean类，我们没法给三方库的类上加注解
    //可以通过@Bean的方式纳入Ioc容器管理
    //通过@ConfigurationProperties给生成的对象赋值
    @Bean
    @ConfigurationProperties(prefix = "other.abc")
    public Address address() {
        return new Address();
    }
}
